import requests
url="https://www.sogou.com/web?"
kw=input("请输入查询的参数")
params={
    "keyword":kw
}
headers={
       "User-Agent":"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36 Edg/111.0.1661.54"
}
response=requests.get(url,headers=headers,params=params)
print(response.status_code)
print(response.text)
#保存爬取的网站html
page_text = response.text
fileName =kw+'.html'
with open(fileName,'w',encoding='utf-8') as fp:
    fp.write(page_text)
print(fileName+"保存成功！！！")